package com.lkm.market2_0.entity;

import com.google.gson.annotations.SerializedName;
import com.lkm.javatool.BitHelp;
import com.lkm.javatool.StringHelp;
import com.lkm.market2_0java.help.GsonHelp;

import java.util.List;




public class SteelyardInfo {



    
    public volatile boolean isNew;
    

    public static final int RunTimeState_subtotal = 1<<0;
    

    public static final int RunTimeState_salesReturn = 1<<1;

    
    
    public static final int RunTimeState_isAddXJ = 1<<2;

    public static final int RunTimeState_isPrint = 1<<3;

    public static final int RunTimeState_salesJoin = 1<<4;

    
    @SerializedName("pos")
    public String pos_;

   private NfcCarInfo nfcCarInfoTemp;

    public NfcCarInfo getPos() {
        if (StringHelp.isEmpty(pos_)) return null;
        if (nfcCarInfoTemp == null)
            nfcCarInfoTemp = GsonHelp.fromJson(pos_, NfcCarInfo.class);
        return nfcCarInfoTemp;
    }

    private int runTimeState = 0;

    public synchronized boolean hasState(int state){
        return BitHelp.hasFlagBit(runTimeState,state);
    }
    public synchronized void removeState(int state){
        runTimeState = BitHelp.removeFlagBit(runTimeState,state);
    }
    public synchronized void removeAllState(){
        runTimeState = 0;
    }
    public synchronized void addState(int state){
        runTimeState = BitHelp.addFlagBit (runTimeState,state);
    }

    
    @SerializedName("dm")
    public String deviceModel;

    
    @SerializedName("dd")
    public String deviceAge;

    
    @SerializedName("org")
    private int org;

    
    @SerializedName("ukey")
    public String steelyardMac;

    
    @SerializedName("b_id")
    public String b_id;

    @Deprecated
    @SerializedName("id")
    private String id;

    @SerializedName("unit")
    public String unit;

    
    @SerializedName("sleep_time")
    public String sleep_time = "";

    
    @SerializedName("traceurl")
    public String traceurl;

    
    
    @SerializedName("stall")
    public StallEntity stallEntity;

    @SerializedName("basis")
    public BasisEntity basisEntity;


    
    @SerializedName("p_breed")
    public String p_breed;
    
    @SerializedName("breed")
    public List<BreedTo> breedTo;


    
    
    @SerializedName("p_url")
    public String outlinePayImg;

    
    @SerializedName("pay")
    private PayTo payInfo;

    
    
    
    @SerializedName("orginfo")
    public OrganizationInfo orginfo;

    
    @SerializedName("api")
    public UpDataApiTo upDataApiTo;


    @SerializedName("auto_print")
    public int auto_print;

    public static int codetype_0 = 0;
    public static int codetype_3=3;
    

    
    @SerializedName("codetype")
    public int codetype;

    
    @SerializedName("codetext")
    public String codetext; 


    
    @SerializedName("fair")
    public FairTo fair;


    public PayTo getPayInfo() {
        return payInfo;
    }

    public String getSteelyardMac() {
        return steelyardMac;
    }

    public void setSteelyardMac(String steelyardMac) {
        this.steelyardMac = steelyardMac;
    }

    public StallEntity getStallEntity() {
        return stallEntity;
    }

    public void setStallEntity(StallEntity stallEntity) {
        this.stallEntity = stallEntity;
    }

    public List<BreedTo> getBreedTo() {
        return breedTo;
    }

    public void setBreedTo(List<BreedTo> breedTo) {
        this.breedTo = breedTo;
    }


    
    public String getB_id() {
        return b_id;
    }

    public void setB_id(String b_id) {
        this.b_id = b_id;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTraceurl() {
        return traceurl;
    }

    public void setTraceurl(String traceurl) {
        this.traceurl = traceurl;
    }

    public FairTo getFair() {
        return fair;
    }


    








//            sb.append(rand.nextInt(10));




    public int getOrg() {
        return org;
    }

    public void setOrg(int org) {
        this.org = org;
    }

    public boolean isAutoPrintSuccessOrder() {
        return auto_print == 1;
    }
}
